UDF Installation
----------------
*.so     Linux compiled Shared Object library file
*.dll    Windows compiled Dynamic Link Library file
*.my.sql MySQL Script file (may need some modification depending on OS)
*.sql    SQL Server script file


MySQL Preparation
-----------------
These instructions don't require that you stop/restart the
server. However, if people are using the registered functions
after they are unregistered they will receive SQL errors.

If you are installing these UDFs for the first time you can
move to step 1. Otherwise you will need to unregister the
libraries before you are given write privileges. If you need
to do this, log into MySQL through a query tool and use the
following command:
mysql> DROP FUNCTION <function_name>;

For this installation you would use the following:
mysql> DROP FUNCTION fn_guid_to_bin;
mysql> DROP FUNCTION fn_bin_to_guid;


Windows MySQL
-------------
1. Copy the .dll files into the MySQL Server bin directory:
   >COPY *.dll C:\Program Files\MySQL\MySQL Server 5.0\bin

2. Register the library. Log into MySQL through a query tool
   and use the following command:
   mysql> CREATE FUNCTION <function_name> RETURNS STRING SONAME '<dll_name>';

   For this installation you would use the following:
   mysql> CREATE FUNCTION fn_guid_to_bin RETURNS STRING SONAME 'udf_guid_to_bin.dll';
   mysql> CREATE FUNCTION fn_bin_to_guid RETURNS STRING SONAME 'udf_bin_to_guid.dll';


Linux MySQL
-----------
1. Copy the .so file to a place where mysql can use it:
   $cp udf_my_function.so /usr/lib

2. Register the library. Log into MySQL through a query tool
   and use the following command:
   mysql> CREATE FUNCTION <function_name> RETURNS STRING SONAME '<so_name>';

   For this installation you would use the following:
   mysql> CREATE FUNCTION fn_guid_to_bin RETURNS STRING SONAME 'udf_guid_to_bin.so';
   mysql> CREATE FUNCTION fn_bin_to_guid RETURNS STRING SONAME 'udf_bin_to_guid.so';


SQL Server Preparation
----------------------
The scripts provided create SYSTEM UDFs. These will behave differently than 
user UDFs in the following ways:
1. They must always be defined in lower case.
2. They must always start with "fn_"
3. They can be executed in any database without identifying an owner
   (also known as owner resolution):
   e.g. no need to use "owner." in "owner.fn_name()" calls.

If you don't have permissions to create SYSTEM UDFs you may register the UDFs
under a specific user, but you must be logged in as that user to be able to use
the UDF without ownership resolution in your code.
Contact Bri Gipson for details.


Windows SQL Server
------------------
1. In SQL Query Analyzer run the script files fn_bin_to_guid.sql and
   fn_guid_to_bin.sql
